<?php

namespace App\Http\Resources;

use Illuminate\Http\Resources\Json\JsonResource;

class DcommentResource extends JsonResource
{
    public function toArray($request)
    {
        return [
            'id' => (int)$this->id,
            'replier_id' => (int)$this->replier_id,
            'poster_id' => (int)$this->poster_id,
            'replier_nickname' => $this->replier_nickname,
            'replier_avatar' => $this->replier_avatar,
            'receiver_id' => (int)$this->receiver_id,
            'receiver_nickname' => $this->receiver_nickname,
            'thumb_count' => (int)$this->thumb_count,
            'content' => $this->content,
            'created_at' => (string) $this->created_at->format('Y-m-d'),
            'updated_at' => (string) $this->updated_at->format('Y-m-d'),
        ];
    }
}
